<?php
namespace app\member\controller;
class Screen extends Common{
	/**
	 * #同步界面#
	 * @return [type] [description]
	 */
	function index(){
		return view();
	}
	/**
	 * #一键更新安装包#
	 * @return [type] [description]
	 */
	function install(){
		if(request()->isAjax()||request()->isPost()){
			$data=[
				'event'=>'install',
			];
			$rs= \socket\Socket::client($data,$this->user['id']);
			if($rs['success']){
				$this->success($rs['msg']);
				die;
			}
			$this->error($rs['msg']);
		}
	}
	/**
	 * 平滑重启socket服务器
	 * @return [type] [description]
	 */
	function reloadSocket(){
		//exec("cd D:\\wwwroot\\yunkong\\IM \r\n pm2 reload all",$out,$res);
		//shell_exec("pm2 kill");
		// if($res===0){
		// 	$this->success('重启成功');
		// 	die;
		// }
		//$this->error('重启失败');
	}
}